<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象扩展</title>
</head>
<body>
    <script>
        //1. 判断两个值是否完全相等    NaN === NaN false
        // console.log(Object.is(1, 1));
        // console.log(Object.is(1, 2));
        // console.log(Object.is(NaN, NaN));

        //2. Object.assign 对象的合并  
        // let obj = {
        //     a:100,
        //     b:200
        // }
        // let obj2 = {
        //     c:300,
        //     d:400,
        // }
        // let obj3 = {
        //     e: 500,
        //     f: 600,
        //     a: 100000
        // }

        // let result = Object.assign(obj, obj2, obj3);

        // console.log(result);
        // console.log(result === obj);

        //3. 直接修改 __proto__ 设置原型
        let a = {cls: 'H5201125'};
        let b = {name: '尚硅谷'};

        //a 对象隐式原型
        a.__proto__ = b;

        console.log(a);



    </script>
</body>
</html>